package com.terry.bootdemo.web.common;

import org.hibernate.HibernateException;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommonDao<T> extends PagingAndSortingRepository<T,Long> {
        void insert(T t)throws HibernateException;
        void update(T t)throws HibernateException;
        void delete(String arg, Object value)throws HibernateException;
        T findEntity(String arg, Object value)throws HibernateException;
        boolean isExist(String arg, Object value)throws HibernateException;
        List<T>  queryAll()throws HibernateException;
        List<T> queryLike(String arg, Object value)throws HibernateException;

}
